// Loesung_von_Aufgabe_2.4.5_4_Drehscheibe

float yE; // y-Wert von Erich, wenn er von der Drehscheibe fliegt
float w; // Winkel
float wz; // Winkelzuwachs
float t; // Zeit

void setup()
{
  size(400, 400);
}

void draw()
{
  background(0, 130, 0);
  translate(200, 200);
  frameRate(60);

  pushMatrix();

  t = t + t/frameRate;

  wz = wz + 0.01;
  w = w + wz;

  rotate(radians(w));

  // Drehscheibe
  fill(255, 255, 0);
  ellipse(0, 0, 200, 200);
  fill(150);
  ellipse(0, 0, 10, 10);
  stroke(210, 210, 0);
  strokeWeight(10);
  line(10, 0, 60, 0);
  line(0, 10, 0, 60);
  line(0, -10, 0, -60);
  line(-10, 0, -60, 0);

  noStroke();
  // Igel Erich
  fill(0, 0, 255);
  ellipse(90, 0, 20, 20); 
  // Hase Heinz
  fill(255, 0, 0);
  ellipse(-105, 0, 20, 20); 

  if (w >= 1260)
  {
    // Erich verschwindet (wird übermalt)
    noStroke();
    fill(255, 255, 0);
    ellipse(90, 0, 21, 21);
  }

  popMatrix();

  // Nach 3,5 Umdrehungen fliegt Erich von der Drehscheibe
  if (w >= 1260)
  {
    yE = yE - 5;
    fill(0, 0, 255);
    ellipse(-90, yE, 20, 20);
  }
}